package com.gph.saviorframework.dao.security;

import com.gph.saviorframework.base.dao.BaseDao;
import com.gph.saviorframework.common.model.Module;
import org.apache.ibatis.annotations.Param;
import org.aspectj.lang.annotation.Aspect;

import java.util.List;
import java.util.Map;

@Aspect
public interface ModuleDao extends BaseDao<Module,String> {

    /**
     * 查询结果集
     * @param sort
     * @param dir
     * @param whereClause
     * @return
     */
    List<Map<String,Object>> find(
            @Param(value = "sort")String sort,
            @Param(value = "dir")String dir,
            @Param(value = "where_clause")String whereClause);

    /**
     * 查询所有，默认order asc排序
     * @return
     */
    List<Map<String,Object>> findAll();

    /**
     * 返回结果集数量
     * @param whereClause
     * @return
     */
    long count(@Param(value = "where_clause")String whereClause);

    /**
     * 查询所有的模块，并查看此模块下是否有function
     * @return
     */
    List<Map<String,Object>> findModules();

    /**
     *
     * @param roleId
     * @return
     */
    List<Map<String,Object>> findModulesByRoleId(@Param(value = "roleId")String roleId);
}
